﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MP3Ganizer.BusinessObject.Infos;

namespace MP3Ganizer.BusinessObject.Services.Organisation
{
    public class OrganisationService
    {
        public IEnumerable<MP3Infos> ApplyInfoFromReference(MP3Infos reference, IEnumerable<MP3Infos> infosToModify)
        {
            IEnumerable<MP3Infos> newInfosList = infosToModify;
            if (reference.Artists != null)
               newInfosList = newInfosList.Select(info => info.ChangeArtists(reference.Artists));
            if (!string.IsNullOrEmpty(reference.Album))
                newInfosList = newInfosList.Select(info => info.ChangeArtists(reference.Artists));
            return newInfosList;
        }
    }
}
